unit RaAccessPass;

interface

uses
  SysUtils, Classes, GetAccessPass;

type
  TRaAccessPass = class(TComponent)
  private
    fFileName: string;
    fDataType: string;
    fPass: string;
    fOnGetPass: TNotifyEvent;
    procedure SetFileName(const Value: string);
  protected
  public
    constructor Create(AOwner: TComponent); override;
  published
    property FileName: string read fFileName write SetFileName;
    property DataType: string read fDataType;
    property Pass: string read fPass;
    property OnGetPass: TNotifyEvent read fOnGetPass write fOnGetPass;
  end;

procedure Register;

implementation

procedure Register;
begin
  RegisterComponents('Rarnu Components', [TRaAccessPass]);
end;

{ TRaAccessPass }

constructor TRaAccessPass.Create(AOwner: TComponent);
begin
  inherited Create(AOwner);
end;

procedure TRaAccessPass.SetFileName(const Value: string);
begin
  fFileName := Value;
  GetAccessPass.GetAccPass(fFileName, fDataType, fPass);
  if Assigned(OnGetPass) then
    OnGetPass(Self);
end;

end.

 